package com.test.webmanage.controller;

import com.test.webmanage.pojo.Result;
import com.test.webmanage.utils.AliOSSUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
public class UploadController {
    @Autowired
    private AliOSSUtils aliOSSUtils;
    @RequestMapping("/upload")
    public Result upload(MultipartFile image) throws IOException {
            String url = aliOSSUtils.upload(image);
            return Result.success(url);

    }
}
